<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>天气</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>

    <div id="mapContainer" style="position: relative;">
    </div>

</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        // position: [120.52950010876321, 30.268289949834518, 1000],
        // lookAt: [120.52950010876321, 30.268289949834518, 0],
        position: [119.5503034398738, 29.34501850151658, 1000],
        lookAt: [119.55097987498354, 29.347578514254775, 10],
        cameraScrollSpeed: 15,
        minZoom: 3,
        maxZoom: 18,
        ambientLightIntensity: 5,
        ambientLightType: 'hemiSphere',
        useCarpet: true,
        background: "Sky",
        useDefaultTexture: true, //是否使用瓦片默认纹理
        baseLayer: [
            {
                maxDataLevel: 16,
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
                readableUrl: true,
                tileType: 'image',
            },
        ]
    });

    btn();
  
    function btn() {
        let button = new GE.Button('晴', function () {
            app.postProcess.rainEffect.enabled = false;
            app.postProcess.snowEffect.enabled = false;
        });
        app.ui.add(button);

        let button7 = new GE.Button('雨', function () {
            app.postProcess.snowEffect.enabled = false;
            let visible = !app.postProcess.rainEffect.enabled;
            app.postProcess.setRainPass(visible, {
                 clockNumber: 0,
            })
        });
        app.ui.add(button7);

        let button8 = new GE.Button('雪', function () {
            app.postProcess.rainEffect.enabled = false;
            let visible = !app.postProcess.snowEffect.enabled;
            app.postProcess.setSnowPass(visible, {
                 clockNumber: 0,
            })
        });
        app.ui.add(button8);
    }
</script>

</html>